import { PageReq, PageRes } from '@/api/types'
import request from '@/utils/request'

// 获取台账列表
export function assetsPageApi(data: PageReq<Partial<any>>) {
  return request<PageRes<any>>({
    url: '/assets/page',
    method: 'post',
    data
  })
}

// 首页获取tag数据
export function getHomeTagApi(data: { orgId: number }) {
  return request<Array<number>>({
    url: '/assets/getHomeTag',
    method: 'post',
    data
  })
}

// 获取部门各类型资产总数
export function getCountOfTypeApi(data: { orgId: number }) {
  return request<Array<any>>({
    url: '/assets/getCountOfType',
    method: 'post',
    data
  })
}

// 获取部门各类型申请总数
export function getReceiveCountApi(data: { orgId: number }) {
  return request<Array<number>>({
    url: '/assets/getReceiveCount',
    method: 'post',
    data
  })
}

// 资产预警
export function assetWarningApi(data: { orgId: number }) {
  return request<Array<{ todoName: string; todoType: 0 | 1 }>>({
    url: '/assets/assetWarning',
    method: 'post',
    data
  })
}
